home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / Komunik / Webscr / HTMLtool / _SETUP.1 / Meta Search.scp < prev    next >
Text File  |  1999-10-03  |  11KB  |  241 lines

  1. <HTMLtool>This script lets the user search up to four engines at once.</HTMLtool>
  2. <script>
  3. Yahoo = "http://search.yahoo.com/bin/search?p=";
  4. Alta = "http://www.altavista.digital.com/cgi-bin/query?pg=q&what=web&q=";
  5. Open = "http://search.opentext.com/omw/simplesearch?SearchFor=";
  6. Lycos = "http://www.lycos.com/cgi-bin/pursuit?query=";
  7. Crawler = "http://www.webcrawler.com/cgi-bin/WebQuery?searchText=";
  8. InfoSeek = "http://guide-p.infoseek.com/Titles?qt=";
  9. DejaNews = "http://search.dejanews.com/nph-dnquery.xp?query=";
  10. Inktomi = "http://204.161.74.8:1234/query/?query=";
  11. MetaCrawler = "http://metacrawler.cs.washington.edu:8080/htbin-post/nph-metaquery.p?general=";
  12. SavySearch = "http://guaraldi.cs.colostate.edu:2000/search?KW=";
  13. Excite = "http://www.excite.com/search.gw?searchType=Concept&search=";
  14. Magellan = "http://www.mckinley.com/searcher.cgi?query=";
  15. Point = "http://point.lycos.com/cgi-bin/pursuit?query=";
  16. Galaxy = "http://www.einet.net/cgi-bin/wais-text-multi?keywords=";
  17. var got=0;
  18. var url = "";
  19. var plus="";
  20. var mag="";
  21.  
  22. function search4(item){
  23.         stringPlus();
  24.         resultsWindow=window.open();
  25.         resultsWindow.document.open();
  26.         resultsWindow.document.write("<head><title>Close this window to return to Search</title></head>");
  27.   resultsWindow.document.write("<FRAMESET ROWS=50%,50%><FRAMESET COLS=50%,50%><FRAME NAME='frame0' SRC='" + computeFrameSrc(0) + "'><FRAME NAME='frame1' SRC='" + computeFrameSrc(1) + "'></FRAMESET>");
  28.         resultsWindow.document.write("<FRAMESET COLS=50%,50%><FRAME NAME='frame2' SRC='" + computeFrameSrc(2) + "'><FRAME NAME='frame3' SRC='" + computeFrameSrc(3) + "'></FRAMESET></FRAMESET>");
  29.         resultsWindow.document.close();
  30.         got = 0;
  31. }
  32.  
  33. function search2(item){
  34.         stringPlus();
  35.         resultsWindow=window.open();
  36.         resultsWindow.document.open();
  37.         resultsWindow.document.write("<head><title>Close this window to return to Search</title></head>");
  38.   resultsWindow.document.write("<FRAMESET ROWS=50%,50%><FRAME NAME='frame0' SRC='" + computeFrameSrc(0) + "'><FRAME NAME='frame1' SRC='" + computeFrameSrc(1) + "'></FRAMESET>");
  39.         resultsWindow.document.close();
  40.         got = 0;
  41. }
  42.  
  43. function stringPlus(){
  44.         for (var j=0; j < window.document.choose4.text.value.length; j++){
  45.                 if (window.document.choose4.text.value.charAt(j) == " ")
  46.                         mag += "+";
  47.                 else
  48.                         mag += window.document.choose4.text.value.charAt(j);}
  49. }
  50.  
  51. function numChecked(item){
  52.         plus = escape(item.text.value);
  53.         var h=0;
  54.         num=0;
  55.         for (var l=0; l < item.check1.length; l++) {
  56.                 if (item.check1[l].checked){
  57.                                 h++;
  58.                         if (h++ <= 4){
  59.                                 if (l == "0"){
  60.                                          num = 1;}
  61.                                 else if (l == "1"){
  62.                                         num = 2;}
  63.                                 else if (l == "2"){
  64.                                         num = 3;}
  65.                                 else if (l == "3"){
  66.                                         num = 4;}
  67.                                 else if (l == "4"){
  68.                                         num = 5;}
  69.                                 else if (l == "5"){
  70.                                         num = 6;}
  71.                                 else if (l == "6"){
  72.                                         num = 7;}
  73.                                 else if (l == "7"){
  74.                                         num = 8;}
  75.                                 else if (l == "8"){
  76.                                         num = 9;}
  77.                                 else if (l == "9"){
  78.                                         num = 10;}
  79.                                 else if (l == "10"){
  80.                                         num = 11;}
  81.                                 else if (l == "11"){
  82.                                         num = 12;}
  83.                                 else if (l == "12"){
  84.                                         num = 13;}
  85.                                 }
  86.                 }
  87.         }
  88.         if (h == 2)
  89.                 Results(num-1);
  90.         else if (h == 4)
  91.                 search2(item);
  92.         else
  93.                 search4(item);
  94. }
  95.  
  96. function computeFrameSrc(num){
  97.         var k=-1;
  98.         for (var j=got; j < document.choose4.check1.length; j++) {
  99.                 if (document.choose4.check1[j].checked){
  100.                                 k++;
  101.                         if (k++ <= num){
  102.                                 if (j == "0"){
  103.                                         url = Yahoo + plus;
  104.                                         got = 1;}
  105.                                 else if (j == "1"){
  106.                                         url = Magellan + mag;
  107.                                         got = 2;}
  108.                                 else if (j == "2"){
  109.                                         url = Point + plus;
  110.                                         got = 3;}
  111.                                 else if (j == "3"){
  112.                                         url = Alta + plus + "&mode=and";
  113.                                         got = 4;}
  114.                                 else if (j == "4"){
  115.                                         url = Open + plus + "&mode=and";
  116.                                         got = 5;}
  117.                                 else if (j == "5"){
  118.                                         url = Lycos + plus + "&backlink=217&maxhits=25";
  119.                                         got = 6;}
  120.                                 else if (j == "6"){
  121.                                         url = Excite + plus + "&category=default&mode=relevance&showqbe=1&display=html3,hb";
  122.                                         got = 7;}
  123.                                 else if (j == "7"){
  124.                                         url = Crawler + plus + "&maxHits=25";
  125.                                         got = 8;}
  126.                                 else if (j == "8"){
  127.                                         url = InfoSeek + plus + "&col=WW";
  128.                                         got = 9;}
  129.                                 else if (j == "9"){
  130.                                         url = DejaNews + plus + "&defaultOp=AND&svcclass=dncurrent&maxhits=25";
  131.                                         got = 10;}
  132.                                 else if (j == "10"){
  133.                                         url = Inktomi + plus + "&hits=25&disp=Text+Only";
  134.                                         got = 11;}
  135.                                 else if (j == "11"){
  136.                                         url = MetaCrawler + plus + "&logic=0®ion=The+World&orgType=Any&maxwait=1&score=0";
  137.                                         got = 12;}
  138.                                 else if (j == "12"){
  139.                                         url = SavySearch + plus + "&classic=on&t1=x&Boolean=AND&Hits=10&Mode=MakePlan&df=normal&AutoStep=on&AutoInt=on&lb=1";
  140.                                         got = 13;}
  141.                                 return url;
  142.                                 }
  143.                 }
  144.         }
  145.         url = "http://www.lograf.com";
  146.         return url;
  147. }
  148.  
  149. function Results(place){
  150.         stringPlus();
  151.         resultsWin = open("","results");
  152.         if (place == "0")
  153.                 url = Yahoo + plus;
  154.         else if (place == "1")
  155.                 url = Magellan + mag;
  156.         else if (place == "2")
  157.                 url = Point + plus;
  158.         else if (place == "3")
  159.                 url = Alta + plus + "&mode=and";
  160.         else if (place == "4")
  161.                 url = Open + plus + "&mode=and";
  162.         else if (place == "5")
  163.                 url = Lycos + plus + "&backlink=217&maxhits=25";
  164.         else if (place == "6")
  165.                 url = Excite + plus + "&category=default&mode=relevance&showqbe=1&display=html3,hb";
  166.         else if (place == "7")
  167.                 url = Crawler + plus + "&maxHits=25";
  168.         else if (place == "8")
  169.                 url = InfoSeek + plus + "&col=WW";
  170.         else if (place == "9")
  171.                 url = DejaNews + plus + "&defaultOp=AND&svcclass=dncurrent&maxhits=25";
  172.         else if (place == "10")
  173.                 url = Inktomi + plus + "&hits=25&disp=Text+Only";
  174.         else if (place == "11")
  175.                 url = MetaCrawler + plus + "&logic=0®ion=The+World&orgType=Any&maxwait=1&score=0";
  176.         else if (place == "12")
  177.                 url = SavySearch + plus + "&classic=on&t1=x&Boolean=AND&Hits=10&Mode=MakePlan&df=normal&AutoStep=on&AutoInt=on&lb=1";
  178.         resultsWin.location = url;
  179. }
  180. </script>
  181.  
  182. <font size=+1>Search</FONT> 
  183. <p>
  184. This script will run the same search across all of 
  185. the major search engines at one time.<p>
  186.  
  187.  
  188. <form name="choose4" Action="javascript:numChecked(document.choose4) //">
  189. <p>
  190. <Font size=4><b>Search and display 1-4 databases simultaneously:</B></font><BR>
  191. <table><tr><td><b>Directories</b><br>
  192. <input type="checkbox" name="check1" value="Yahoo"
  193.                 onClick="choose4.check1.value='Yahoo'">Yahoo<br>
  194.  
  195. <input type="checkbox" name="check1" value="Magellan"
  196.                 onClick="choose4.check1.value='Magellan'">Magellan<br>
  197.  
  198. <input type="checkbox" name="check1" value="Point"
  199.                 onClick="choose4.check1.value='Point'">Point<br><br></td>
  200.  
  201. <td width="15"></td>
  202.  
  203. <td><b>Search Engines</b><br>
  204. <input type="checkbox" name="check1" value="Alta"
  205.                 onClick="choose4.check1.value='Alta'">Alta Vista<br>
  206.  
  207. <input type="checkbox" name="check1" value="Open"
  208.                 onClick="choose4.check1.value='Open'">Open Text<br> 
  209.  
  210. <input type="checkbox" name="check1" value="Lycos"
  211.                 onClick="choose4.check1.value='Lycos'">Lycos<br>
  212.  
  213. <input type="checkbox" name="check1" value="Excite"
  214.                 onClick="choose4.check1.value='Excite'">Excite<br></td>
  215.  
  216. <td><br><input type="checkbox" name="check1" value="Crawler"
  217.                 onClick="choose4.check1.value='Crawler'">Webcrawler<br>
  218.  
  219. <input type="checkbox" name="check1" value="InfoSeek"
  220.                 onClick="choose4.check1.value='InfoSeek'">InfoSeek<br> 
  221.  
  222. <input type="checkbox" name="check1" value="DejaNews"
  223.                 onClick="choose4.check1.value='DejaNews'">DejaNews<br>
  224.  
  225. <input type="checkbox" name="check1" value="Inktomi"
  226.                 onClick="choose4.check1.value='Inktomi'">Inktomi<br> 
  227. </td>
  228. <td width="15"></td>
  229. <td><b>Meta Searches</b><br>
  230. <input type="checkbox" name="check1" value="MetaCrawler"
  231.                 onClick="choose4.check1.value='MetaCrawler'">MetaCrawler<br>
  232.  
  233. <input type="checkbox" name="check1" value="SavySearch"
  234.                 onClick="choose4.check1.value='SavySearch'">SavySearch<BR><br><br>
  235. </td></tr></table>
  236. <P>
  237. <B>Enter text to find</B>:<BR>
  238. <input type="text" name="text" size=30>
  239. <input type="submit" name="send" value="Search">
  240. <input type="reset" name="clear" value="Clear All">
  241. </form>